package com.example.devicemanage.service.impl;

import com.example.devicemanage.dao.AdminMapper;
import com.example.devicemanage.entity.Admin;
import com.example.devicemanage.entity.User;
import com.example.devicemanage.service.inter.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceimp implements AdminService {
    @Autowired
    AdminMapper adminMapper;
    @Override
    public boolean login(Admin admin) {
       String name=admin.getName();

        //调用dao层查询数据库
        Admin admin1 = adminMapper.queryAdminByname(name);
        if(admin1 == null || !admin1.getPassword().equals(admin.getPassword()))
            return false;
        else
            return true;
    }
}
